#pragma once

#ifndef _CORE_SAFE_OURPUT_STREAM_H_
#define _CORE_SAFE_OURPUT_STREAM_H_

#include "Poco/Net/SocketStream.h"
#include "Poco/Net/Socket.h"
#include "Core/SafeMutex.h"

namespace ExamSystem
{
    using Poco::Net::SocketStream;
    using Poco::Net::SocketInputStream;
    using Poco::Net::SocketOutputStream;
    using Poco::Net::Socket;

    class SafeSocketStream : public SocketStream, public CSafeMutex
    {
    public:
        explicit SafeSocketStream(const Socket& socket) : SocketStream(socket) { }
    };

    class SafeSocketInputStream : public SocketInputStream, public CSafeMutex
    {
    public:
        explicit SafeSocketInputStream(const Socket& socket) : SocketInputStream(socket) { }
    };

    class SafeSocketOutputStream : public SocketOutputStream, public CSafeMutex
    {
    public:
        explicit SafeSocketOutputStream(const Socket& socket) : SocketOutputStream(socket) { }
    };
}

#endif